home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / PcodeSystem.h < prev    next >
Text File  |  1994-12-27  |  3KB  |  83 lines

  1. /* PcodeSystem.h */
  2.  
  3. #ifndef Included_PcodeSystem_h
  4. #define Included_PcodeSystem_h
  5.  
  6. /* PcodeSystem module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* EventLoop */
  13. /* DataMunging */
  14. /* Alert */
  15. /* FixedPoint */
  16. /* FloatingPoint */
  17. /* PcodeStack */
  18. /* PcodeObject */
  19. /* CodeCenter */
  20. /* SampleConsts */
  21. /* FunctionCode */
  22. /* InteractionWindow */
  23. /* Numbers */
  24.  
  25. #include "FixedPoint.h"
  26. #include "SampleConsts.h"
  27.  
  28. /* forward declarations */
  29. struct ParamStackRec;
  30. struct PcodeRec;
  31. struct CodeCenterRec;
  32. union OpcodeRec;
  33. struct InteractionWindowRec;
  34.  
  35. /* the errors that can occur when evaluating a pcode program */
  36. typedef enum
  37.     {
  38.         eEvalNoError EXECUTE(= -7865),
  39.         eEvalUndefinedFunction,
  40.         eEvalWrongNumParametersForFunction,
  41.         eEvalWrongParameterType,
  42.         eEvalWrongReturnType,
  43.         eEvalErrorTrapEncountered,
  44.         eEvalUserCancelled,
  45.         eEvalDivideByZero,
  46.         eEvalOutOfMemory,
  47.         eEvalArrayDoesntExist,
  48.         eEvalArraySubscriptOutOfRange,
  49.         eEvalGetSampleNotDefined,
  50.         eEvalGetSampleWrongChannelType
  51.     } EvalErrors;
  52.  
  53. /* evaluate the provided function using the initial stack provided in Prep, */
  54. /* the program provided in Pcode, the object pool provided in CodeCenter, */
  55. /* and the callback routines for obtaining samples.  the SampleName parameter */
  56. /* of the callback routine is a NULL termimated string. */
  57. /* If an error occurs, the OpcodeRec and program counter of the instruction */
  58. /* that generated the exception are returned.  the Prep is used in place, which */
  59. /* means that any changes made to the stack during evaluation will be available */
  60. /* in the Prep when the function returns.  Stack depth is NOT changed, though. */
  61. EvalErrors                EvaluatePcode(struct ParamStackRec* Prep, struct PcodeRec* Pcode,
  62.                                         struct CodeCenterRec* CodeCenter, union OpcodeRec** OffendingPcode,
  63.                                         long* OffendingInstruction, void* Refcon,
  64.                                         SampleErrors (*GetSampleLeftCopy)(void* Refcon, char* SampleName,
  65.                                             largefixedsigned** SampleData),
  66.                                         SampleErrors (*GetSampleRightCopy)(void* Refcon, char* SampleName,
  67.                                             largefixedsigned** SampleData),
  68.                                         SampleErrors (*GetSampleMiddleCopy)(void* Refcon, char* SampleName,
  69.                                             largefixedsigned** SampleData),
  70.                                         SampleErrors (*GetWaveTableFrameCount)(void* Refcon,
  71.                                             char* WaveTableName, long* FrameCountOut),
  72.                                         SampleErrors (*GetWaveTableTableCount)(void* Refcon,
  73.                                             char* WaveTableName, long* TableCountOut),
  74.                                         SampleErrors (*GetWaveTableCopy)(void* Refcon, char* WaveTableName,
  75.                                             largefixedsigned** WaveTableData),
  76.                                         void* IRefCon,
  77.                                         struct InteractionWindowRec* (*GetInteractionWindow)(void* IRefCon));
  78.  
  79. /* return a static null terminated string describing an error code. */
  80. char*                            GetPcodeErrorMessage(EvalErrors Error);
  81.  
  82. #endif
  83.